package com.kalaqia.adapter.recycler;

import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.view.ViewGroup;

import com.bumptech.glide.Glide;
import com.bumptech.glide.ListPreloader;
import com.bumptech.glide.RequestBuilder;

import net.idik.lib.slimadapter.SlimAdapterEx;
import net.idik.lib.slimadapter.SlimViewHolder;

import java.util.Collections;
import java.util.List;

/**
 * function:
 * project:ImageLoader
 * describe:
 * created owner:kalaqia 421407393@qq.com
 * created date:2017/10/17 9:41
 */
//<editor-fold desc="version update log">
// updare owner:kalaqia  421407393@qq.com
// update datetime:2017/10/17 9:41 
// update remark:
//</editor-fold>
public class ImageSlimAdapter<T> extends SlimAdapterEx
        implements ListPreloader.PreloadSizeProvider<T>,
        ListPreloader.PreloadModelProvider<T> {

    private int[] actualDimensions;
    private RequestBuilder<Drawable> requestBuilder;

    @Override
    public SlimViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return super.onCreateViewHolder(parent, viewType);
    }

    public void registerRequestBuilder(RequestBuilder<Drawable> requestBuilder) {
        this.requestBuilder = requestBuilder;
    }

    @Nullable
    @Override
    public int[] getPreloadSize(T t, int i, int i1) {
        return actualDimensions;
    }

    @NonNull
    @Override
    public List<T> getPreloadItems(int i) {
//        return Collections.singletonList(data.get(position));
        return null;
    }

    @Nullable
    @Override
    public RequestBuilder getPreloadRequestBuilder(T t) {
        return null;
    }
}
